import request from "@/utils/req";

// // 编辑用户
// export const editUserDataById = (id: number, data: any) => {
//   return hyRequest.patch({
//     url: `/users/${id}`,
//     data: data,
//   })
// }

// 获取部门列表
export function getDepartmentListApi() {
  return request({
    url: "/company/department",
    method: "get",
  });
}

// 获取部门负责人列表
export function getDepartmentLeaderListApi() {
  return request({
    url: "/sys/user/simple",
    method: "get",
  });
}
// 获取部门详情数据
export function getDepartmentDetailApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: "get",
  });
}

// 新增部门信息
export function addDepartmentApi(data) {
  return request({
    url: "/company/department",
    method: "post",
    data,
  });
}

// 更新部门信息
export function updateDepartmentApi(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: "put",
    data,
  });
}

//删除部门信息
export function delDepartmentApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: "delete",
  });
}
